<!DOCTYPE html>
<html lang="zh">

<head>
    <title></title>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <script src="https://cdn.jsdelivr.net/npm/vue@2.6.14/dist/vue.js"></script>
    <link href="../css/style.css" rel="stylesheet"> </head>

<body>
    <div id="myApp">
        <div :class="myClass">红色文本</div>
        <button @click="btnClick">改变class吧</button>
    </div>
    <script>
        var myApp = new Vue({
            el: '#myApp',
            data: {
                myClass: {
                    active: true,
                    big: true,
                },
            },
            methods: {
                btnClick: function() {
                    this.myClass.active = !this.myClass.active;
                    this.myClass.big = !this.myClass.big;
                },
            },
        });
    </script>
</body>

</html>